package com.zt.teacher;

import com.zt.teacher.netty.NettyServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(scanBasePackages = "com.zt")
public class TeacherApplication implements CommandLineRunner {

    @Autowired
    private NettyServer nettyServer;

    public static void main(String[] args) {
        SpringApplication.run(TeacherApplication.class, args);
    }

    @Override
    public void run(String... args) {
        new Thread(()->{
            try {
                nettyServer.run(8888);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }).start();
    }

}
